<template>
	<view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		onLoad() {
			this.initData();
		},
		methods: {
			initData(){
				uni.showLoading({
					title: '加载中',
					mask: true
				})
				this.$request({
					url: `/blade-merchant-app/merchant-app/user/getUser`,
					type: 'GET'
				}).then(res => {
					setTimeout(()=>{
						uni.hideLoading();
						uni.setStorageSync('nickName', res.data.name);
						uni.setStorageSync('userId', res.data.id);
						uni.setStorageSync('identity', res.data.identity);
						//身份（1：普通用户，2：场馆主，3：教练员，4：指导员，5：体检中心,7:商家）
						if(res.data.identity == 2) {
							uni.switchTab({
								url:"/pages/index/main"
							})
						} else if(res.data.identity == 3){
							uni.redirectTo({
								url:"/pages/index/coach"
							})
						} else if(res.data.identity == 4){
							uni.redirectTo({
								url:"/pages/index/instructor"
							})
						} else if(res.data.identity == 7){
							uni.redirectTo({
								url:"/pages/index/venueBusiness"
							})
						}
					},800)
				})
			}
		}
	}
</script>

<style>

</style>